﻿/*******************************************************************************
 * AAEngine
 * Copyright (c) 2010 Mike Jarosch
 *
 * Original source PushButton Engine:
 * Copyright (C) 2009 PushButton Labs, LLC
 * For more information see http://www.pushbuttonengine.com
 *
 * This file is licensed under the terms of the MIT license, which is included
 * in the "MIT License.txt" file at the root directory of this SDK.
 ******************************************************************************/

using System.Xml.Linq;

namespace AAEngine.Engine.Resources
{
    public class XmlResource : Resource
    { 
        private XDocument _document;

        public override void Initialize(object data)
        {
            base.Initialize(data);

            _document = XDocument.Parse((string)data);
//            _document.XmlResolver = null;
//            _document.LoadXml((string)data);
        }

        public override void Dispose()
        {
            _document = null;

            base.Dispose();
        }

        public XElement Data
        {
            get { return _document.Root; }
        }
    }
}
